
<form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
    <div class="row">
        <div class="col-md-4 col-xs-12 form-group">
            <label for="c-number" class="control-label col-xs-12 col-sm-2">{:__('项目编号')}:</label>
            <div class="col-xs-12 col-sm-8">
                <input id="c-number"  type="text" class="form-control" name="row[number]" value="{$row.number}"/>
            </div>
        </div>
        <div class="col-md-4 col-xs-12 form-group">
            <label for="c-name" class="control-label col-xs-12 col-sm-2">{:__('项目名称')}:</label>
            <div class="col-xs-12 col-sm-8">
                <input id="c-name" data-rule="required" type="text" class="form-control" name="row[name]" value="{$row.name|htmlentities}"/>
            </div>
        </div>
        <div class="col-md-4 col-xs-12 form-group">
            <label for="c-jobs" class="control-label col-xs-12 col-sm-2">{:__('作业内容')}:</label>
            <div class="col-xs-12 col-sm-8">

                <div class="checkbox">
                    {foreach name="w_config['jobs']" item="vo"}
                    <label for="row[jobs][]-{$key}">
                        <input id="row[jobs][]-{$key}" {in name="key" value="$row['jobs']" }checked{/in} name="row[jobs][]" type="checkbox" value="{$key}" data-rule="checked"> {$vo}
                    </label>
                    {/foreach}
                </div>
            </div>
        </div>

        {php}
        $facrm_config=get_addon_info('facrm');
        {/php}
        {if $facrm_config}
        <div class="col-md-4 col-xs-12 form-group">
            <label for="c-customer_id" class="control-label col-xs-12 col-sm-2">{:__('客户')}:</label>
            <div class="col-xs-12 col-sm-8">
                <input id="c-customer_id" data-rule="required" data-source="facrm/customer/index"
                       class="form-control selectpage" name="row[customer_id]" type="text" value="{$row.customer_id}" >
            </div>
        </div>
        {/if}
        <div class="col-md-4 col-xs-12 form-group {if $facrm_config} hide{/if}">
            <label for="c-customer_name" class="control-label col-xs-12 col-sm-2">{:__('客户名称')}:</label>
            <div class="col-xs-12 col-sm-8">
                <input id="c-customer_name" data-rule="required" type="text" class="form-control" name="row[customer_name]" value="{$row.customer_name|htmlentities}"/>
            </div>
        </div>


        <div class="col-md-4 col-xs-12 form-group">
            <label for="c-contacts_name" class="control-label col-xs-12 col-sm-2">{:__('联系人')}:</label>
            <div class="col-xs-12 col-sm-8">
                <input id="c-contacts_name" data-rule="required" type="text" class="form-control" name="row[contacts_name]" value="{$row.contacts_name|htmlentities}"/>
            </div>
        </div>

        <div class="col-md-4 col-xs-12 form-group">
            <label for="c-order_time" class="control-label col-xs-12 col-sm-2">{:__('下单时间')}:</label>
            <div class="col-xs-12 col-sm-8">
                <input id="c-order_time"  class="form-control datetimepicker"
                       data-date-format="YYYY-MM-DD" data-use-current="true" name="row[order_time]"  type="text"  value="{:datetime($row.order_time)}">
            </div>
        </div>

        <div class="col-md-4 col-xs-12 form-group">
            <label for="c-price" class="control-label col-xs-12 col-sm-2">{:__('项目金额')}:</label>
            <div class="col-xs-12 col-sm-8">
                <input id="c-price" type="number" class="form-control" name="row[price]" value="{$row.price}"/>
            </div>
        </div>


        <div class="col-md-4 col-xs-12 form-group">
            <label for="c-start_time" class="control-label col-xs-12 col-sm-2">{:__('开始时间')}:</label>
            <div class="col-xs-12 col-sm-8">
                <input id="c-start_time"  class="form-control datetimepicker"
                       data-date-format="YYYY-MM-DD HH:mm" data-use-current="true" name="row[start_time]" type="text" value="{:datetime($row.start_time)}">
            </div>
        </div>
        <div class="col-md-4 col-xs-12 form-group">
            <label for="c-end_time" class="control-label col-xs-12 col-sm-2">{:__('截止时间')}:</label>
            <div class="col-xs-12 col-sm-8">
                <input id="c-end_time" value="{:datetime($row.end_time)}"  class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm"
                       data-use-current="true" name="row[end_time]" type="text">
            </div>
        </div>
        <div class="col-md-4 col-xs-12 form-group">
            <label for="c-test_time" class="control-label col-xs-12 col-sm-2">{:__('初稿时间')}:</label>
            <div class="col-xs-12 col-sm-8">
                <input id="c-test_time" value="{:datetime($row.test_time)}"  class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm"
                       data-use-current="true" name="row[test_time]" type="text">
            </div>
        </div>

        <div class="col-md-4 col-xs-12 form-group">
            <label for="c-sales_admin_id" class="control-label col-xs-12 col-sm-2">{:__('业务经理')}:</label>
            <div class="col-xs-12 col-sm-8">
                <input id="c-sales_admin_id"  data-source="workteam/common/selectpage/model/admin/type/all" data-field="nickname"
                       class="form-control selectpage" name="row[sales_admin_id]" type="text"  value="{$row.sales_admin_id}"  data-rule="required">

            </div>
        </div>
        <div class="col-md-4 col-xs-12 form-group">
            <label for="c-project_admin_id" class="control-label col-xs-12 col-sm-2">{:__('项目经理')}:</label>
            <div class="col-xs-12 col-sm-8">
                <input id="c-project_admin_id"  data-source="workteam/common/selectpage/model/admin/type/all" data-field="nickname"
                       class="form-control selectpage" name="row[project_admin_id]" type="text" value="{$row.project_admin_id}"  data-rule="required" >

            </div>
        </div>
        <div class="col-md-4 col-xs-12 form-group">
            <label for="c-admin_ids" class="control-label col-xs-12 col-sm-2">{:__('参与人')}:</label>
            <div class="col-xs-12 col-sm-8">
                <input   data-source="workteam/common/selectpage/model/admin/type/all" data-field="nickname" id="c-admin_ids"
                         class="form-control selectpage" name="row[admin_ids]" type="text" value="{$row.admin_ids}" data-multiple="true">

            </div>
        </div>

        <div class="col-md-4 col-xs-12 form-group">
            <label for="c-plan_hours" class="control-label col-xs-12 col-sm-2">{:__('计划工时')}:</label>
            <div class="col-xs-12 col-sm-8">
                <input id="c-plan_hours" type="number" class="form-control" name="row[plan_hours]" value="{$row.plan_hours}" />

            </div>
        </div>
        <div class="form-group col-md-4 col-xs-12">
            <label class="control-label col-xs-12 col-sm-2">{:__('优先级')}:</label>
            <div class="col-xs-12 col-sm-8">
                <select id="c-level" class="form-control selectpicker" name="row[level]">
                    {foreach name="levelList" item="vo"}
                    <option value="{$key}" {in name="key" value="$row.level" }selected{/in}>{$vo}</option>
                    {/foreach}
                </select>
                <span class="text-red "></span>
            </div>
        </div>
        <div class="form-group col-md-4 col-xs-12">
            <label class="control-label col-xs-12 col-sm-2">{:__('项目状态')}:</label>
            <div class="col-xs-12 col-sm-8">
                <select id="c-status" class="form-control selectpicker" name="row[status]">
                    {foreach name="statusList" item="vo"}
                    <option value="{$key}" {in name="key" value="$row.status" }selected{/in}>{$vo}</option>
                    {/foreach}
                </select>
                <span class="text-red ">{:__('* 归档的项目不能更改')}</span>
            </div>
        </div>

        <div class="form-group col-md-4 col-xs-12 complete_time"  {if $row.status < 2}style="display: none"{/if}>
            <label class="control-label col-xs-12 col-sm-2">{:__('完成时间')}:</label>
            <div class="col-xs-12 col-sm-8">
                <input id="c-complete_time" value="{$row.complete_time?datetime($row.complete_time):time()}"  class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm"
                       data-use-current="true" name="row[complete_time]" type="text">
                <span class="text-red "></span>
            </div>
        </div>

        <div class="col-md-4 col-xs-12 form-group">
            <label for="c-remark" class="control-label col-xs-12 col-sm-2">{:__('备注')}:</label>
            <div class="col-xs-12 col-sm-8">
                <textarea id="c-remark" class="form-control" name="row[remark]">{$row.remark|htmlentities}</textarea>
            </div>
        </div>
        <div class="col-md-4 col-xs-12 form-group">
            <label for="c-content" class="control-label col-xs-12 col-sm-2">{:__('项目说明')}:</label>
            <div class="col-xs-12 col-sm-8">
                <textarea id="c-content" class="form-control editor" name="row[content]">{$row.content}</textarea>

            </div>
        </div>

        <div class="col-md-4 col-xs-12 form-group">
            <label for="c-wx_webhook" class="control-label col-xs-12 col-sm-2">{:__('企微机器人')}:</label>
            <div class="col-xs-12 col-sm-8">
                <input id="c-wx_webhook"  type="text" class="form-control" name="row[wx_webhook]" placeholder="企业微信通知，需要先设置通知。可留空，默认系统配置的" value="{$row.wx_webhook|htmlentities}"/>
            </div>
        </div>
        <div class="col-md-4 col-xs-12 form-group">
            <label for="c-dd_webhook" class="control-label col-xs-12 col-sm-2">{:__('钉钉机器人')}:</label>
            <div class="col-xs-12 col-sm-8">
                <input id="c-dd_webhook"  type="text" class="form-control" name="row[dd_webhook]"  placeholder="钉钉通知，需要先设置通知。可留空，默认系统配置的" value="{$row.dd_webhook|htmlentities}"/>
            </div>
        </div>



    </div>

    <div class="row">

        <div class="panel panel-default panel-intro col-xs-12 col-md-12">
            <div class="panel-heading">
                <div class="panel-lead"><em>{:__('附件')}</em></div>

            </div>
            <div class="panel-body">
                <div id="toolbar" class="toolbar">
                    {:build_toolbar('refresh')}
                    <input type="hidden" id="c-third" value="">
                    <button type="button" id="faupload-third" class="btn btn-danger faupload {:$auth->check('workteam/project/filesadd')?'':'hide'}" data-multiple="true" data-input-id="c-third" >
                        <i class="fa fa-upload"></i> {:__('上传')}</button>


                </div>
                <table id="table" class="table table-striped table-bordered table-hover table-nowrap"
                       data-operate-filesdel="{:$auth->check('workteam/project/filesdel')}"
                       width="100%">
                </table>

            </div>
        </div>




    </div>




    <div class="form-group layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <button type="submit" class="btn btn-success btn-embossed disabled">{:__('OK')}</button>
            <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
        </div>
    </div>
</form>
<script>
    var project_id={$row.id};

</script>






